<template>
	<gui-page :customHeader="false">

		<!-- 	<template slot="gHeader" >
			<view style="display: flex;justify-content: space-between;align-content: center;height: 150rpx;">
				<view @tap="back" class="gui-icons back_icon" style="">&#xe600;</view>
				<view>错误回顾</view>
				<text style="width: 100rpx;"></text>
			</view>
		</template> -->
		<!-- 页面主体 -->
		<template v-slot:gBody>

			<!-- <view class="gui-margin-top gui-padding gui-text-center gui-color-gray" v-if="recordList.length <= 0">
				暂无数据
			</view> -->

			<view class="">

				<view class="gui-flex"
					style="justify-content: space-around;padding: 20rpx;color: #666666; margin-top: 40rpx; color: black; font-size: 35rpx;">
					<view>
						共{{totalCount}}道错题
					</view>
					<view>
						今日新增{{todayCount}}题
					</view>
				</view>
				
				<view class="gui-margin-top gui-padding gui-text-center gui-color-gray"
					v-if="errorData.length <= 0">
					暂无数据
				</view>
				<view v-else class="gui-border-radius-large gui-margin gui-border gui-bg-white "
					style="padding: 10rpx 0rpx;">

					<view class="gui-padding  gui-border-b " v-for="(d,i) in errorData"
						style="display: flex;justify-content: space-between; align-items: center;">
						<view>
							<view class="title">
								{{d.throughtName}}
							</view>
							<view class="gui-color-gray gui-text">
								{{d.isCom}}道错误
							</view>
						</view>
						<!-- <view>
							<text class="gui-icons">&#xe601;</text>
						</view> -->

					</view>
				</view>
			</view>

		</template>
	</gui-page>
</template>

<script>
	export default {
		data() {
			return {
				recordList: [],
				page_index: 1,
				errorData: [],
				todayCount: 0,
				totalCount: 0
			}
		},
		onLoad() {
			this.get_data();
		},
		methods: {
			back() {
				uni.navigateBack();
			},
			get_data() {
				let self = this;
				let url = "/API-RUSH/front/frontRushGaste/queryMyErrorRushRecord?page=1&pageSize=20&type=1&isCom=1";
				this.$lg.Get(url, {
					page: this.page_index,
					pageSize: 20,
					isCom: 1
				}, function(res) {
					console.log('错题回顾res: ', res);
					self.todayCount = res.data.todayCount;
					self.totalCount = res.data.totalCount;
					self.errorData = res.data.errorRushRecord.rows;
				}, err => {
					console.log('错题回顾err: ', err);
				}, false, false)

			}
		}
	}
</script>

<style>
	page {
		width: 100vw;
		height: 100vh;
		background: url("https://boyaltd.oss-cn-hangzhou.aliyuncs.com/bj_liand.png") 100% 100% / 100% 100%;
		/* background-repeat:no-repeat; */
	}
</style>